
import React, { Component ,useState, useEffect} from 'react';
import './App.css';
import { NavLink } from "react-router-dom";
import Aside from './pages/main/Aside'
import Router from './router';
import {
  RecoilRoot,
} from 'recoil';
import { useLocation } from "react-router";

String.prototype.trim = function () {
  return this.replace(/(^\s*)|(\s*$)/g, '');
}



function App() {


  // const location = useLocation()

  useEffect(() => {
    if(localStorage.getItem('themeBgColor')){
      document.getElementsByClassName('App')[0].style.backgroundColor = '#f8f8f8'
    }
    return ()=>{
      
    }
  },[]);

  

  return (
    <RecoilRoot>
    <div className="App">
      <aside className='aside-box'>
        <Aside/>
      </aside>
      <div style={{flex: '1',height: '100%'}}>
        <Router/>
      </div>
    </div>
    </RecoilRoot>
  );
}

export default App;
